
<template>
  <div>
       
    <el-container>
  <el-aside width="200px">
    <el-radio-group v-model="isCollapse" style="margin-bottom: 20px;">
  <el-radio-button :label="false">展开</el-radio-button>
  <el-radio-button :label="true">收起</el-radio-button>
</el-radio-group>
<el-menu default-active="1-4-1" class="el-menu-vertical-demo" @open="handleOpen" @close="handleClose" :collapse="isCollapse">
    <el-menu-item index="1">
    <i class="el-icon-menu"></i>
    <span slot="title">
   <router-link to="/p1/3">导航路由1</router-link>     
       
    </span>
  </el-menu-item>
  <el-menu-item index="2">
    <i class="el-icon-menu"></i>
    <span slot="title" @click="qu2">编程路由二</span>
  </el-menu-item>
  <el-menu-item index="3" >
    <i class="el-icon-document"></i>
    <span slot="title">
        <router-link to="/p5">导航5-正式内侧</router-link>
        
    </span>
  </el-menu-item>
  <el-menu-item index="4">
    <i class="el-icon-setting"></i>
    <router-link to="/p6">导航6-演示内侧</router-link>
  </el-menu-item>
</el-menu>
  </el-aside>
  <el-container>
    <el-header>Header</el-header>
    <el-main>
        <!-- 嵌套子路由 -->
        <router-view/>
    </el-main>
  </el-container>
</el-container>


    
  </div>
</template>

<script>
export default {
    data() {
      return {
        isCollapse: false
      };
    },
    methods: {
      handleOpen(key, keyPath) {
        console.log(key, keyPath);
      },
      handleClose(key, keyPath) {
        console.log(key, keyPath);
      },qu2(){//编程路由 主推 推送方式
          this.$router.push({
            path:'/p2',
            query:{
                name:'我是编程路由'
            }
          });  
      }
    }

}
</script>

<style>
.el-radio-group{
    background-color: chartreuse;
}
.el-menu{
    background-color: #cbc644;
}
.el-menu-vertical-demo:not(.el-menu--collapse) {
    width: 200px;
    min-height: 400px;
  }
.el-container{
    height: 400px;
}
 .el-header, .el-footer {
    background-color: #B3C0D1;
    color: #333;
    text-align: center;
    line-height: 60px;
  }
  
  .el-aside {
    background-color: #D3DCE6;
    color: #333;
    text-align: center;
    line-height: 200px;
  }
  
  .el-main {
    background-color: #E9EEF3;
    color: #333;
    text-align: center;
    line-height: 160px;
  }
  
  body > .el-container {
    margin-bottom: 40px;
  }
  
  .el-container:nth-child(5) .el-aside,
  .el-container:nth-child(6) .el-aside {
    line-height: 260px;
  }
  
  .el-container:nth-child(7) .el-aside {
    line-height: 320px;
  }
</style>